<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>旧机入库单</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=e9c5bb62">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=66b457d6">
    <style>
        td {
            width: 110px;
            height: 30px
        }
    </style>

</head>
<body>
<div class="text" style=" text-align:center;font-weight:bold;font-size: 25px;">旧机入库单</div>

<div id="app">

    <table id="OriginalCustomerInformation" border="1" align="center" style="margin:15px auto;text-align: center">
        <tr>
            <td colspan="8" style="text-align: center;background-color: #00caed">
                原客户信息
            </td>
        </tr>
        <tr>
            <td>原客户姓名</td>
            <td><input type="text" id="customerName" v-model="customerName" style="border:none"></td>
            <td>身份证号</td>
            <td><input type="text" id="idCard" v-model="idCard" style="border:none"></td>
            <td>电话</td>
            <td><input type="text" id="tel" v-model="tel" style="border:none"></td>
            <td>交机地址</td>
            <td><input type="text" id="deliveryAddress" v-model="deliveryAddress" style="border:none"></td>
        </tr>
        <!--基本信息-->
        <tr>
            <td colspan="8" style="text-align: center;background-color: #00caed">
                基本信息
            </td>
        </tr>
        <tr>
            <td>入库编号</td>
            <td><input type="text" id="inboundId" v-model="inboundId" style="border:none"></td>
            <td>入库操作员</td>
            <td><input type="text" id="createUser" v-model="createUser" style="border:none"></td>
            <td>入库日期</td>
            <td><input type="text" id="createTime" v-model="createTime" style="border:none"></td>
            <td>入库区域</td>
            <td><input type="text" id="inboundPlace" v-model="inboundPlace" style="border:none"></td>
        </tr>
        <tr>
            <td>公司</td>
            <td>
                <select id="testCom" v-model="companyId" @change="getBran">
                    <option v-for="itemC in itemsCom" v-bind:value="itemC.id">{{itemC.name}}</option>
                </select>
            </td>

            <td>设备品牌</td>
            <td>
                <select v-model="brandId" @change="getMod">
                    <option v-for="itemB in itemsBran" v-bind:value="itemB.id">{{itemB.name}}</option>
                </select>
            </td>
            <td>设备型号</td>
            <td>
                <select id="testMod" v-model="modelId" @change="getBuc">
                    <option v-for="itemMo in itemsMod" v-bind:value="itemMo.modelId">{{itemMo.modelName}}</option>
                </select>
            </td>
            <td>特殊斗容</td>
            <td>
                <select id="testBucked" v-model="bucketCapacity">
                    <option v-for="itemBu in itemsBuc" v-bind:value="itemBu.bucketCapacity">{{itemBu.bucketCapacity}}
                    </option>
                </select>
            </td>
        </tr>
        <tr>
            <td>出厂年份</td>
            <td><input type="text" id="year" v-model="year" style="border:none"></td>
            <td>小时数</td>
            <td><input type="text" id="hour" v-model="hour" style="border:none"></td>
            <td>区域经理</td>
            <td><input type="text" id="regionManager" v-model="regionManager" style="border:none"></td>
            <td>设备来源</td>
            <td><input type="text" id="source" v-model="source" style="border:none"></td>
        </tr>
        <tr>
            <td>原始发票</td>
            <td><input type="text" id="originalInvoice" v-model="originalInvoice" style="border:none"></td>
            <td>合格证</td>
            <td><input type="text" id="certification" v-model="certification" style="border:none"></td>
            <td>设备状态</td>
            <td><input type="text" id="state" v-model="state" style="border:none"></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>VECU小时数</td>
            <td><input type="text" id="VECUHour" v-model="VECUHour" style="border:none"></td>
            <td>债权车补贴(元)</td>
            <td><input type="text" id="debtCarSubsidy" v-model="debtCarSubsidy" style="border:none"></td>
            <td>补贴说明</td>
            <td><input type="text" id="subsidyDescription" v-model="subsidyDescription " style="border:none"></td>
            <td>车位编号</td>
            <td><input type="text" id="parkingSpaceNumber" v-model="parkingSpaceNumber" style="border:none"></td>
        </tr>
        <tr>
            <td>序列号</td>
            <td><input type="text" id="sequence" v-model="sequence" style="border:none"></td>

            <td>存放地</td>
            <td><input type="text" id="storagePlace" v-model="storagePlace" style="border:none"></td>
            <td>设备类型</td>
            <td><input type="text" id="deviceType" v-model="deviceType" style="border:none"></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>备注</td>
            <td colspan="8"><input type="text" id="remark" v-model="remark" style="border:none"></td>
        </tr>
        <!--评估置换-->
        <tr>
            <td colspan="8" style="text-align: center;background-color: #00caed">
                评估置换
            </td>
        </tr>
        <tr>
            <td>评估人</td>
            <td><input type="text" id="assessUser" v-model="assessUser" style="border:none"></td>
            <td>评估价格(元)</td>
            <td><input type="text" id="assessPrice" v-model="assessPrice" style="border:none"></td>
            <td>评估日期</td>
            <td><input type="text" id="assesssDate" v-model="assesssDate" style="border:none"></td>
            <td>购入价格(元)</td>
            <td><input type="text" id="purPrice" v-model="purPrice" style="border:none"></td>
        </tr>
        <tr>
            <td>入库运费(元)</td>
            <td><input type="text" id="inboundShipping" v-model="inboundShipping" style="border:none"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>置换机型</td>
            <td><input type="text" id="repModel" v-model="repModel" style="border:none"></td>
            <td>序列号</td>
            <td><input type="text" id="squenceAS" v-model="squenceAS" style="border:none"></td>
            <td>限价(元)</td>
            <td><input type="text" id="limitPrice" v-model="limitPrice" style="border:none"></td>
            <td>新机售价(元)</td>
            <td><input type="text" id="newCarPrice" v-model="newCarPrice" style="border:none"></td>
        </tr>
        <!--销售成本-->
        <tr>
            <td colspan="8" style="text-align: center;background-color: #00caed">
                销售成本
            </td>
        </tr>
        <tr>
            <td>维修金额(元)</td>
            <td><input type="text" id="repairPrice" v-model="repairPrice" style="border:none"></td>
            <td>折让金额(元)</td>
            <td><input type="text" id="discountPrice" v-model="discountPrice" style="border:none"></td>
            <td>销售报价(元)</td>
            <td><input type="text" id="salesQuotation" v-model="salesQuotation" style="border:none"></td>
            <td>销售底价(元)</td>
            <td><input type="text" id="sellingPrice" v-model="sellingPrice" style="border:none"></td>
        </tr>
        <tr>
            <td>配件欠款(元)</td>
            <td><input type="text" id="accessoriesArrears" v-model=" accessoriesArrears" style="border:none"></td>
            <td>成本总价(元)</td>
            <td><input type="text" id="totalCost" v-model="totalCost" style="border:none"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>备注及保修</td>
            <td><input type="text" id="remarksAndWarranty" v-model="remarksAndWarranty" style="border:none"></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>备注</td>
            <td colspan="8"><input type="text" id="remarkSa" v-model="remarkSa" style="border:none"></td>
        </tr>
    </table>
    <div align="center">
        <input type="button" value="提交" @click="saveOld()" style="width: 80px">
    </div>
</div>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=0b5caf39"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=0c4d95a9"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<!--oa-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=63aed32f"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/apply/money/class.js"></script>
<script type="text/javascript" src="/dist/js/pages/system/systemService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/print/print.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript">
    var vm2 = new Vue({
        el: '#app',
        data: {
            /*下拉列表*/
            itemsCom: [],
            itemsBran: [],
            itemsMod: [],
            itemsBuc: [],
            /*原客户信息*/
            customerName: '',
            idCard: '',
            tel: '',
            deliveryAddress: '',
            /*基本信息*/
            companyId: '',
            bucketCapacity: '',
            inboundId: '',
            createUser: '',
            createTime: '',
            inboundPlace: '',
            deviceType: '',
            brandId: '',
            modelId: '',
            sequence: '',
            year: '',
            storagePlace: '',
            remark: '',
            state: '',
            hour: '',
            source: '',
            regionManager: '',
            originalInvoice: '',//原始发票
            certification: '',
            VECUHour: '',
            debtCarSubsidy: '',
            subsidyDescription: '',
            parkingSpaceNumber: '',
            /*评估置换*/
            assessUser: '',
            assessPrice: '',
            assesssDate: '',
            purPrice: '',
            inboundShipping: '',
            repModel: '',
            squenceAS: '',
            limitPrice: '',
            newCarPrice: '',
            /*销售成本*/
            repairPrice: '',
            discountPrice: '',
            salesQuotation: '',
            sellingPrice: '',
            accessoriesArrears: '',
            totalCost: '',
            remarksAndWarranty: '',
            remarkSa: '',
        },
        methods: {
            /*选中公司下拉表时触发此事件,查询该公司下的品牌*/
            getBran(){
                var that = this;
                var s = that.companyId;
                var data = {'companyId': s.toString()};
                $.wyui.postMethod('/companyBrand/findBrandList.json', data, function (r) {
                    console.log(r);
                    that.itemsBran = r.brands;
                })
            },
            /*选中品牌下拉表时触发此事件,查询该品牌下的型号*/
            getMod(){
                var that = this;
                var s = that.brandId;
                var data = {'brandId': s};
                $.wyui.postMethod('/deviceModel/getModelList.json', data, function (r) {
                    console.log(r);
                    that.itemsMod = r.records;
                })
            },
            /*选中型号下拉表时触发此事件,查询该型号下的斗容*/
            getBuc(){
                var that = this;
                var s = that.modelId;
                var s2 = that.brandId;
                var data = {'modelId': s, 'brandId': s2};
                $.wyui.postMethod('/deviceModel/getBucketCapacityList.json', data, function (r) {
                    console.log(r);
                    that.itemsBuc = r;
                })
            },

            saveOld(){
                alert("信息填写完毕，是否确认提交");
                /*原客户信息*/
                $.wyui.postMethod('/device/saveOldCustomer.json', {
                    name: this.customerName,
                    idCard: this.idCard,
                    tel: this.tel,
                    deliveryAddress: this.deliveryAddress,
                }, function (r) {
                    console.log(r);
                    if (r.bool) {
                        // location.href = "deviceList.html";
                    } else {
                        alert("原客户信息保存失败请重新操作");
                    }
                });
                /*基本信息*/
                $.wyui.postMethod('/device/saveDevice.json', {
                    inboundId: this.inboundId,
                    createUser: this.createUser,
                    createTime: this.createTime,
                    inboundPlace: this.inboundPlace,
                    companyId: this.companyId,
                    brandId: this.brandId,
                    modelId: this.modelId,
                    year: this.year,
                    hour: this.hour,
                    regionManager: this.regionManager,
                    source: this.source,
                    originalInvoice: this.originalInvoice,
                    certification: this.certification,
                    state: this.state,
                    VECUHour: this.VECUHour,
                    debtCarSubsidy: this.debtCarSubsidy,
                    subsidyDescription: this.subsidyDescription,
                    parkingSpaceNumber: this.parkingSpaceNumber,
                    sequence: this.sequence,
                    storagePlace: this.storagePlace,
                    deviceType: this.deviceType,
                    remark: this.remark,
                    delFlag: '0',
                }, function (r) {
                    console.log(r);
                    if (r.bool) {
                        location.href = "deviceList.html";
                    } else {
                        alert("保存失败请重新操作");
                    }
                });

                /*评估置换*/
                $.wyui.postMethod('/device/saveAssess.json', {
                    assessUser: this.assessUser,
                    assessPrice: this.assessPrice,
                    assesssDate: this.assesssDate,
                    purPrice: this.purPrice,
                    inboundShipping: this.inboundShipping,
                    repModel: this.repModel,
                    squenceAS: this.squenceAS,
                    limitPrice: this.limitPrice,
                    newCarPrice: this.newCarPrice,

                }, function (r) {
                    console.log(r);
                    if (r.bool) {
                        // location.href = "deviceList.html";
                    } else {
                        alert("评估置换信息保存失败请重新操作");
                    }
                });
                /*销售成本*/
                $.wyui.postMethod('/device/saveSalesCost.json', {

                    /* repairPrice: '',
                     discountPrice: '',
                     salesQuotation: '',
                     sellingPrice: '',
                     accessoriesArrears: '',
                     totalCost: '',
                     remarksAndWarranty: '',
                     remarkSa: '',*/
                    repairPrice: this.repairPrice,
                    discountPrice: this.discountPrice,
                    salesQuotation: this.salesQuotation,
                    sellingPrice: this.sellingPrice,
                    accessoriesArrears: this.accessoriesArrears,
                    totalCost: this.totalCost,
                    remarksAndWarranty: this.remarksAndWarranty,
                    remarkSa: this.remarkSa,
                }, function (r) {
                    console.log(r);
                    if (r.bool) {
                        // location.href = "deviceList.html";
                    } else {
                        alert("销售成本信息保存失败请重新操作");
                    }
                });


            }/*save*/


        },
        mounted: function () {
            var that = this;
            /*首先显示公司下拉表*/
            $.wyui.postMethod('/companyBrand/findCompanyList.json', {}, function (r) {
                console.log(r);
                that.itemsCom = r.companies;
            });
        }

    });

</script>
</body>
</html>